package com.jt.demo2.aop;

import com.jt.demo2.config.SpringConfig;
import com.jt.demo2.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class TestAspect {
    public static void main(String[] args) {
        ApplicationContext a = new AnnotationConfigApplicationContext(SpringConfig.class);
        UserService  userService= a.getBean(UserService.class);
        System.out.println(userService.getClass());
        userService.hello();

        userService.findName();
        String name = userService.findName();
        System.out.println(name);//打印返回值
    }

}
